Type TChrono
	Field clock=0
	Field offset=0
	Field total_offset=0
	Field clock_mode=0
End Type 



Function TChrono_Create.TChrono()
	Local c.TChrono = New TChrono
	c\clock=0
	c\offset=0
	c\total_offset=0
	c\clock_mode=0
	Return c
End Function 



Function TChrono_Reset( c.TChrono )
	c\clock=MilliSecs()
	c\offset=MilliSecs()
	c\total_offset=0
	TChrono_Reset(c)
End Function 



Function TChrono_Text$( c.TChrono )
 	Local t=0
	If c\clock_mode=1 Then t=MilliSecs()-c\clock-c\total_offset
	If c\clock_mode=0 Then t=c\offset-c\clock-c\total_offset
	Local h=t/10
	Local s=h/100
	
	h=h-(s*100)
	Local m=s/60
	s=s-(m*60)
	
	Return Right("00"+m,2)+":"+Right("00"+s,2)+":"+Right("00"+h,2)
End Function 



Function TChrono_StartStop( c.TChrono )
	If c\clock_mode=0
		c\clock_mode=1
		c\total_offset=c\total_offset+MilliSecs()-c\offset
	Else
		c\clock_mode=0
		c\offset=MilliSecs()
	EndIf
End Function 
;~IDEal Editor Parameters:
;~C#Blitz3D